/*
 * EasyBounceRankList.h
 *
 *  Created on: 2009-3-14
 *      Author: Wayne
 */

#ifndef EASYBOUNCERANKLIST_H_
#define EASYBOUNCERANKLIST_H_

// INCLUDE FILES
#include <e32base.h>
#include <badesca.h>

#include "EasyBounceRankDataReader.h"

/**
*  Rank list class
*/
class CEasyBounceRankList : public CBase
    {
    public:

        /**
        * Default 1st phase factory method.
        * Creates an instance of CEasyBounceRankList
        */
        static CEasyBounceRankList* NewL();
      
        /**
        * Default 1st phase factory method.
        * Creates an instance of CEasyBounceRankList, leaves it on stack
        */
        static CEasyBounceRankList* NewLC();
        
        /**
        * Destructor
        */
        virtual ~CEasyBounceRankList();
      
    private:

        /**
        * 2nd Phase constructor
        */
        void ConstructL();
      
        /**
        * C++ Constructor
        */
        CEasyBounceRankList();
      
    private:
    	
    	/**
    	 * 
    	 */
        void LoadRankDataL();
        
        /**
         * 
         */
        TInt InsertPosition( TInt aScore ); 
      
    public:
    	
    	/**
    	 * 
    	 */
    	void GetRankDataL( CDesCArray* aArray );
    	
    	/**
    	 * 
    	 */
    	TBool SetNewRecord( TInt aScore );
    	
    	/**
    	 * 
    	 */
        TInt SetName( const TDesC& aName );
        
        void UpdateRankData(TBuf<32>* aDes);
        
        void ReadRankDataL();
    	
    private: // member data
    	
    	// Name array
        RPointerArray<HBufC> iName;
        
        // Score array
        RArray<TInt> iScore;
        
        // Insert position
        TInt iPos;
        
        CEasyBounceDataReader* iDataReader;
    	
    };

#endif /* EASYBOUNCERANKLIST_H_ */
